<!DOCTYPE html>
<html>
<#include "include/header.html"/>
<body>
<div class="page">
	<div class="content">
		<div class="tab_4a"  id="more" data-type="">
			<div class="item on" id="allOrder"  onclick="oneOrderDetails(''); return false;"><span>全部订单</span></div>
			<#if allStandByPay == 0>
			<div class="item" id="allStandByPay"  onclick="oneOrderDetails('01'); return false;"><span>待付款<i></i></span></div>
			<#else>
			<div class="item" id="allStandByPay"  onclick="oneOrderDetails('01'); return false;"><span>待付款<i>${allStandByPay!}</i></span></div>
			</#if>
			<#if allUnveile == 0>
			<div class="item" id="allUnveile"  onclick="oneOrderDetails('09'); return false;"><span>待揭晓<i></i></span></div>
			<#else>
			<div class="item" id="allUnveile"  onclick="oneOrderDetails('09'); return false;"><span>待揭晓<i>${allUnveile!}</i></span></div>
			</#if>
			<#if allDelivery == 0>
			<div class="item" id="allDelivery"  onclick="oneOrderDetails('02'); return false;"><span>待发货<i></i></span></div>
			<#else>
			<div class="item" id="allDelivery"  onclick="oneOrderDetails('02'); return false;"><span>待发货<i>${allDelivery!}</i></span></div>
			</#if>
			<#if allStandByCollect == 0>
			<div class="item" id="allStandByCollect"  onclick="oneOrderDetails('03'); return false;"><span>待收货<i></i></span></div>
			<#else>
			<div class="item" id="allStandByCollect"  onclick="oneOrderDetails('03'); return false;"><span>待收货<i>${allStandByCollect!}</i></span></div>
			</#if>
			
		</div>
		
		<div class="product_list" id="one_record">
		<#list oneRecord as r>
		<div class="order_list" >
			<div class="item_top">
				<div class="order">订单号:${r.order_no!}</div>
				<div class="time">时间:${r.create_date!}</div>
				<div class="status">订单状态:${r.key_value!}</div>
				<div class="total">金额:${r.total_price!}元</div>
				<div class="btn_group">
					<#if r.order_status == '02'  && r.is_add_addr =='02'>
<!-- 					<div class="btn btn_orange btn_mini"  >提醒商家</div>
 -->					</#if>
					<#if r.order_status == '01'>
					<div class="btn btn_orange btn_mini" onclick="orderForward('${r.id!}');">付款</div>
					</#if>
					<#if r.order_status == '03'>
					<div class="btn btn_orange btn_mini" onclick="confirmReceipt('${r.id!}');">确认收货</div>
					</#if>
				</div>
			</div>
		</div>
		</#list>
		<#if pageNumber lt totalPage>
			<li id="pageNum1" style="text-align: center;"><div onclick="nextPage1(${pageNumber}); return false;"><span class="more">更多<span class="arrow1"></span><span class="arrow2"></span></span></div></li>
		</#if> 
		</div>
		
	</div>
</div>
<!--查看号码-->
<div class="dialog" id="num">
	<div class="dialog_content">
		<div class="alert">
			<div class="desc">
				燃烧吧少年—燃烧杯<br>
				参与<span class="red">1</span>人次，夺宝号码：<br>
				100000312
			</div>
			<div class="ctr">
				<div class="btn btn_white btn_mini" onClick="dialogClose()">确定</div>
			</div>
		</div>	
	</div>
</div>
<script type="text/javascript">
$(function(){
$(".item").removeClass("on");
var order_status="${order_status!}";
if(order_status == ""){
	 $("#allOrder").addClass("on");
}else if(order_status == "01"){
	 $("#allStandByPay").addClass("on");
}else if(order_status == "02"){
	 $("#allDelivery").addClass("on");
	
}else if(order_status == "03"){
	 $("#allStandByCollect").addClass("on");
}else if(order_status == "09"){
	 $("#allUnveile").addClass("on");
}

	oneOrderDetails=function(type){
		 $(".item").removeClass("on");
		 if(type == ""){
			 $("#allOrder").addClass("on");
			 $("#more").data("type","");
		 }else if(type == "01"){
			 $("#allStandByPay").addClass("on");
			 $("#more").data("type","01");
		 }else if(type == "02"){
			 $("#allDelivery").addClass("on");
			 $("#more").data("type","02");
		 }else if(type == "03"){
			 $("#allStandByCollect").addClass("on");
			 $("#more").data("type","03");
		 }else if(type == "09"){
			 $("#allUnveile").addClass("on");
			 $("#more").data("type","09");
		 }
		 $.post("${ctx}/one/oneOrderDetails",{
			 order_status:type
				},function(json){
					var htm="";
					var list=json.list;
					for(var i in list){
						htm+="<div class='order_list' >";
						htm+="<div class='item_top'>";
						var order_no=(list[i].order_no ==null)?"":list[i].order_no;
						htm+="<div class='order'>订单号:"+order_no+"</div>"; 
						var create_date=(list[i].create_date ==null)?"":list[i].create_date;
						htm+="<div class='time'>时间:"+create_date+"</div>";
						var order_status=(list[i].order_status == null)?"":list[i].key_value;
						htm+="<div class='status'>订单状态:"+order_status+"</div>";
						var total_price=(list[i].total_price == null)?"0.00":list[i].total_price;
						htm+="<div class='total'>金额:"+total_price+"元</div>";
						if(list[i].order_status == "02"&&list[i].is_add_addr == "02"){
						}else if(list[i].order_status == "01"){
							htm+="<div class='btn_group'>";
							htm+="<div class='btn btn_orange btn_mini' onclick="+"orderForward('"+list[i].id+"');"+">付款</div>";
							htm+="</div>";
						}else if(list[i].order_status == "03"){
							htm+="<div class='btn_group'>";
							htm+="<div class='btn btn_orange btn_mini' onclick="+"confirmReceipt('"+list[i].id+"');"+">确认收货</div>";
							htm+="</div>";
						}
						htm+="</div></div>";
					}
					if(json.pageNumber < json.totalPage){
						htm+="<li id='pageNum1' style='text-align: center;'><div onclick='nextPage1("+json.pageNumber+"); return false;'><span class='more'>更多<span class='arrow1'></span><span class='arrow2'></span></span></div></li>";
					}
					$("#one_record").html(htm);
			},'json');
	 };
	 nextPage1=function(pnum){
		 $("#pageNum1").remove();
		 $.post("${ctx}/one/oneOrderDetails",{
			 order_status:$("#more").data("type"),
			 page:pnum+1
				},function(json){
					var htm="";
					var list=json.list;
					for(var i in list){
						htm+="<div class='order_list' >";
						htm+="<div class='item_top'>";
						var order_no=(list[i].order_no ==null)?"":list[i].order_no;
						htm+="<div class='order'>订单号:"+order_no+"</div>"; 
						var create_date=(list[i].create_date ==null)?"":list[i].create_date;
						htm+="<div class='time'>时间:"+create_date+"</div>";
						var order_status=(list[i].order_status == null)?"":list[i].key_value;
						htm+="<div class='status'>订单状态:"+order_status+"</div>";
						var total_price=(list[i].total_price == null)?"0.00":list[i].total_price;
						htm+="<div class='total'>金额:"+total_price+"元</div>";
						if(list[i].order_status == "02"&&list[i].is_add_addr == "02"){
							htm+="<div class='btn_group'>";
							htm+="<div class='btn btn_orange btn_mini' >提醒商家</div>";
							htm+="</div>";
						}else if(list[i].order_status == "01"){ 
							htm+="<div class='btn_group'>";
							htm+="<div class='btn btn_orange btn_mini' onclick="+"orderForward('"+list[i].id+"');"+">付款</div>";
							htm+="</div>";
						}else if(list[i].order_status == "03"){
							htm+="<div class='btn_group'>";
							htm+="<div class='btn btn_orange btn_mini' onclick="+"confirmReceipt('"+list[i].id+"');"+">确认收货</div>";
							htm+="</div>";
						}
						htm+="</div></div>";	
					}
					if(json.pageNumber < json.totalPage){
						htm+="<li id='pageNum1' style='text-align: center;'><div onclick='nextPage1("+json.pageNumber+"); return false;'><span class='more'>更多<span class='arrow1'></span><span class='arrow2'></span></span></div></li>";
					}
					$("#one_record").append(htm);
			},'json');
	 };
	 orderForward = function(value){
		 window.location.href ="${ctx}/pay/orderForwardConfirm?total_id="+value+"&commodity_type=02";
	 };
	 oneDetail=function(total_id){
		 window.location.href="${ctx}/one/onePurchaseOrderDetail?total_id="+total_id;
	 };	
	 confirmReceipt=function(total_id){
		 window.location.href="${ctx}/one/confirmReceipt?total_id="+total_id+"&order_status="+$("#more").data("type");
	 }
})
</script>
</body>
</html>